home *** CD-ROM | disk | FTP | other *** search
- (*----------------------------------------------------------------------*)
- (* Min --- Find minimum of two integers *)
- (*----------------------------------------------------------------------*)
-
- FUNCTION Min( A, B: INTEGER ) : INTEGER;
-
- (*----------------------------------------------------------------------*)
- (* *)
- (* Function: Min *)
- (* *)
- (* Purpose: Returns smaller of two numbers *)
- (* *)
- (* Calling sequence: *)
- (* *)
- (* Smaller := MIN( A , B ) : INTEGER; *)
- (* *)
- (* A --- 1st input integer number *)
- (* B --- 2nd input integer number *)
- (* Smaller --- smaller of A, B returned *)
- (* *)
- (* *)
- (* Calls: None *)
- (* *)
- (* *)
- (*----------------------------------------------------------------------*)
-
- BEGIN (* Min *)
-
- IF A < B THEN
- Min := A
- ELSE
- Min := B;
-
- END (* Min *);
-
- (*----------------------------------------------------------------------*)
- (* Max --- Find maximum of two integers *)
- (*----------------------------------------------------------------------*)
-
- FUNCTION Max( A, B: INTEGER ) : INTEGER;
-
- (*----------------------------------------------------------------------*)
- (* *)
- (* Function: Max *)
- (* *)
- (* Purpose: Returns larger of two numbers *)
- (* *)
- (* Calling sequence: *)
- (* *)
- (* Larger := MAX( A , B ) : INTEGER; *)
- (* *)
- (* A --- 1st input integer number *)
- (* B --- 2nd input integer number *)
- (* Larger --- Larger of A, B returned *)
- (* *)
- (* *)
- (* Calls: None *)
- (* *)
- (*----------------------------------------------------------------------*)
-
- BEGIN (* Max *)
-
- IF A > B THEN
- Max := A
- ELSE
- Max := B;
-
- END (* Max *);
-
- (*----------------------------------------------------------------------*)
- (* Rmin --- Find minimum of two reals *)
- (*----------------------------------------------------------------------*)
-
- FUNCTION Rmin( A, B: REAL ) : REAL;
-
- (*----------------------------------------------------------------------*)
- (* *)
- (* Function: Rmin *)
- (* *)
- (* Purpose: Returns smaller of two real numbers *)
- (* *)
- (* Calling sequence: *)
- (* *)
- (* Smaller := RMIN( A , B : REAL ) : REAL; *)
- (* *)
- (* A --- 1st input real number *)
- (* B --- 2nd input real number *)
- (* Smaller --- smaller of A, B returned *)
- (* *)
- (* *)
- (* Calls: None *)
- (* *)
- (* *)
- (*----------------------------------------------------------------------*)
-
- BEGIN (* Rmin *)
-
- IF A < B THEN
- Rmin := A
- ELSE
- Rmin := B;
-
- END (* Rmin *);
-
- (*----------------------------------------------------------------------*)
- (* Rmax --- Find maximum of two reals *)
- (*----------------------------------------------------------------------*)
-
- FUNCTION Rmax( A, B: REAL ) : REAL;
-
- (*----------------------------------------------------------------------*)
- (* *)
- (* Function: Rmax *)
- (* *)
- (* Purpose: Returns larger of two real numbers *)
- (* *)
- (* Calling sequence: *)
- (* *)
- (* Larger := RMAX( A , B : REAL ) : REAL; *)
- (* *)
- (* A --- 1st input real number *)
- (* B --- 2nd input real number *)
- (* Larger --- Larger of A, B returned *)
- (* *)
- (* *)
- (* Calls: None *)
- (* *)
- (*----------------------------------------------------------------------*)
-
- BEGIN (* Rmax *)
-
- IF A > B THEN
- Rmax := A
- ELSE
- Rmax := B;
-
- END (* Rmax *);